/**
 * Vue plugin for i18n
 * Provides $t method globally in Vue components
 */

import { t, setLanguage, getLanguage } from './index'

export default {
  install (Vue) {
    Vue.prototype.$t = function (key, params) {
      return t(key, params)
    }

    Vue.prototype.$setLanguage = function (lang) {
      setLanguage(lang)
    }

    Vue.prototype.$getLanguage = function () {
      return getLanguage()
    }
  }
}
